
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="img/favicon.ico">

    <title>OwlH Master</title>

    <!-- Bootstrap core CSS -->
    <link href="css/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- fontawesome -->
    <link rel="stylesheet" href="css/fontawesome/css/all.css">


    <!-- Custom styles for this template -->
    <link href="css/offcanvas.css" rel="stylesheet">
  </head>

  <body class="bg-light">

    <nav class="navbar navbar-expand-lg fixed-top navbar-dark bg-dark">
        <img class="mr-3" src="img/owlhblack.png" alt="" height="30"><a class="navbar-brand mr-auto mr-lg-0"
        href="nodes.html"><small>Master </small><i id="menu-title" class="text-warning"></i> | </a>
      <!-- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button> -->


      <div class="navbar-collapse offcanvas-collapse" id="navbarsExampleDefault">
        <ul class="navbar-nav mr-auto">
          <li class="nav-item active">
            <a class="nav-link" href="nodes.html">Nodes</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="groups.html">Groups</a>
          </li>
          <li class="nav-item">
              <a class="nav-link" href="rulesets.html">Open Rules</span></a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="response.html">Adapt & Response</a>
          </li>s
          <!-- <li class="nav-item">
            <a class="nav-link" href="kibana.html">Kibana</a>
          </li> -->
          <li class="nav-item">
            <a class="nav-link" href="master.html">Master</a>
        </li>
          <li class="nav-item">
            <a class="nav-link" href="config.html">Config</a>
          </li>
        </ul>
        <p id="current-version-text" class="text-justify text-white">v:</p><p class="text-justify text-white mr-4" id="current-version-show"></p>
      </div>
    </nav>


    <main role="main" class="container">
      <div class="d-flex align-items-center p-3 my-3 text-white-50 bg-low-blue rounded shadow-sm">
        <img class="mr-3" src="img/owlhblack.png" alt="" height="48">
        <div class="lh-100">
          <h3 class="mb-0 text-white lh-100">Software TAP Configuration</h3>
          <small id="subtitle-servers-list"></small>
        </div>
      </div>

      <div class="container" id="servers-table">
      </div>

      <small class="d-block text-right mt-3">
        <a class="btn btn-primary float-right text-decoration-none text-white" style="color:#337ab7; font-weight:bold; float:right;" id="show-add-server" onclick="showAddServerForm()">Add Server</a>
      </small>
    
      <div class="container" style="display: none;" id="serverform">
        <form id="nodedetails">
          <div class="form-row" style="" id="">
            <div class="form-group col-md-6">
              <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                <div class="input-group-prepend">
                  <span class="input-group-text wt-125">Node Name</span>
                </div>
                <input type="text" class="form-control" id="nodenameform" placeholder="node-name">
              </div>
            </div>
          </div>
          <div class="form-row" style="" id="">
            <div class="form-group col-md-6">
              <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                <div class="input-group-prepend">
                  <span class="input-group-text wt-125">Node IP</span>
                </div>
                <input type="text" class="form-control" id="nodeipform" placeholder="x.x.x.x">
              </div>
            </div>
          </div>
          <div class="form-row" style="" id="">
            <a class="btn btn-primary float-right text-decoration-none text-white" style="color: #337ab7; font-weight: bold;" onclick="addServerToNode()">Add</a>
          </div>
        </form>
      </div>
    
    
      <!--Mostrar formulario para modificar información e los nodos (IP, nid y puerto del nodo)-->
      <!--Show the form for modify node inroamtion(IP, nid and port)-->
      <div class="container" style="display: none;" id="divconfigform">
        <form id="configform">
          <div class="form-row">
            <div class="form-group col-md-6">
              <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                <div class="input-group-prepend">
                  <span class="input-group-text wt-125">Node Name</span>
                </div>
                <input type="text" class="form-control" id="cfgnodename" placeholder="node-name" required>
              </div>
            </div>
          </div>
          <div class="form-row">
            <div class="form-group col-md-6">
              <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                <div class="input-group-prepend">
                  <span class="input-group-text wt-125">Node IP</span>
                </div>
                <input type="text" class="form-control" id="cfgnodeip" placeholder="x.x.x.x" required>
              </div>
            </div>
            <div class="form-group col-md-6">
              <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                <div class="input-group-prepend">
                  <span class="input-group-text wt-125">Node Port</span>
                </div>
                <input type="text" class="form-control" id="cfgnodeport" placeholder="10443" required>
                <input type="hidden" class="form-control" id="cfgnodeid" placeholder="10443" required>
              </div>
            </div>
          </div>
      </div>

        <!-- Footer -->
        <div id="footer"></div>

        <!-- Modal edit server -->
        <div class="modal fade" id="modal-edit-stap-server">
        </div>
        
        <!-- Modal delete server -->
        <div class="modal fade" id="modal-delete-stap-server">
        </div>

      <!-- Load master ip/port -->
      <div id="load-json-data" style="display: none;">
          <input id="ip-master" type="text" class="form-control">
          <input id="port-master" type="text" class="form-control">
      </div>        
    </main>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/axios/dist/axios.js"></script> 
    <script src="js/jquery-3.4.1.js"></script>
    <script src="css/dist/js/bootstrap.min.js"></script>
    <script src="js/offcanvas.js"></script>
    <script src="js/stap.js"></script>
    <script src="js/loadTitle.js"></script>
    <script src="js/footer.js"></script>
  </body>
</html>

